﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml;

namespace Ashwani.Cryptography.Symmetric
{
    public interface ISymmetricCryptoProvider
    {
        /// <summary>
        /// Encrypts an array of bytes using the configured key and algorithm.
        /// </summary>
        /// <param name="value">The bytes to encode</param>
        /// <returns>The encrypted bytes</returns>
        byte[] Encrypt(byte[] plaintext);

        /// <summary>
        /// Decrypts the array of bytes using the configured key and algorithm.
        /// </summary>
        /// <param name="value">The bytes to decode</param>
        /// <returns>The decrypted bytes</returns>
        byte[] Decrypt(byte[] ciphertext);

        /// <summary>
        /// Encrypts the specific element in the xml document.
        /// </summary>
        /// <param name="Doc">xml document</param>
        /// <param name="ElementName">element to encrypt</param>
        /// <returns>The encrypted xml document</returns>
        void EncryptXml(XmlDocument Doc, string ElementName);

        /// <summary>
        /// Decrypts the xml document
        /// </summary>
        /// <param name="Doc">The Encrypted XML document that contains "EncryptedData" element</param>
        /// <returns>The decrypted xml document</returns>
        void DecryptXml(XmlDocument Doc);
    }
}
